<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>任务详情</title>
    <div th:include="layout/resources :: resources"></div>
</head>
<body>
<div class="container-fluid">
    <table id="errorMsg"></table>
</div>
</body>
<script th:inline="javascript">
    $("#errorMsg").framework().bootstrapTable({
        height: 400,
        search: false,
        pagination: false,
        columns: [
            {
                field: '',
                title: '序号',
                align: 'center',
                valign: 'middle',
                formatter: function (value, row, index) {
                    return index + 1;
                }
            }, {
                field: 'flowName',
                title: '流程',
                align: 'center',
                valign: 'middle'
            }, {
                field: 'errorCode',
                title: '错误码',
                align: 'center',
                valign: 'middle'
            }, {
                field: 'stepNum',
                title: '步骤',
                align: 'center',
                valign: 'middle'
            }, {
                field: 'count',
                title: '数量',
                align: 'center',
                valign: 'middle'
            }]
    })
    $(function () {
        var error = ['成功', '异常', 'vpn异常', '验证码异常', ''];
        $.ajax({
            method: "get",
            url: createUrl('/taskDetail/getErrorCodeByGroup/' + [[${id}]] + '/[[${fun}]]'),
            success: function (data) {
                //  $("#errorMsg").append('<div><label>' + data[i].flowName + '</label>&nbsp;&nbsp;&nbsp;&nbsp;<label>' + error[data[i].errorCode] + '</label>&nbsp;&nbsp;&nbsp;&nbsp;<span name="count">' + data[i].count + '</span><label>步骤</label>&nbsp;&nbsp;&nbsp;&nbsp;<span name="count">' + data[i].stepNum + '</span></div>');
                for (i in data) {
                    var nowData = data[i];
                    nowData.errorCode = error[data[i].errorCode];
                    $("#errorMsg").bootstrapTable('append', nowData);
                }
            }
        })
    })
</script>
</html>
